import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import P01 from './P01';
export default async function a014(fd: IFeidaoAiBrowserComponent) {
	const productid1 = get(fd, 'productid');
	let asc = get(fd, 'asc') as [];
	let desc = get(fd, 'desc') as [];
	if (!asc) {
		asc = [];
	}
	if (!desc) {
		desc = [];
	}
	const select = fd.data.node.querySelector<HTMLSelectElement>('[select]');
	const index = select.options.selectedIndex;
	const client_point_id = select.options[index].value;
	const res1 = await nodejs<{ dataArray: Array<{}> }>('level-inf/zj-000001/s008', { productid: productid1, client_point_id, asc, desc });
	render(fd, res1.dataArray, P01, 'P01', 'inner');
}
